
#ifndef commKTask_h
#define commKTask_h
/**
 * @defgroup nxbot_commTask COMMTASK Library
 * @ingroup nxbot_task_level
 * @code #include <commKTask.h> @endcode
 * @brief PWM library for applying different velocities to the motors in NXBOT. 
 *
 * This module uses timer0 of the ATmega1281 microcontroller for generating the desired PWM signals. Timer0 is configured in <i>Free Running mode</i>,
 * and it is constantly compared with two registers (OC0 and OC1), in order to toggle the logical state of two pins, where the PWM signals to the
 * motors are connected. Another two signals are used in order to set the desired direction of the motor. For FORWARD direction use <b>positive</b>
 * values, for BACKWARD direction use <b>negative</b> values.
 * This library does not need to have the interrupts in order to function correctly, it is not an interrupt-driven module.
 * 
 */
 
/**@{*/


#define GET_SPEED 						'E'
#define SET_SPEED 						'D'
#define SET_KP 								'P'
#define SET_KI 								'I'
#define SET_POSITION 					'G'
#define GET_POSITION 					'H'
#define SET_ENCODERS 					'O'
#define GET_ENCODERS 					'S'
#define GET_IRSENSOR 					'N'
#define GET_BUMPSENSOR 				'M'
#define GET_BATT_STATE 				'Q'
#define GET_SONARS 						'W'
#define GET_SW_VERSION 				'B'
#define SET_SOUND_JINGLE 			'R'
#define COMMUNICATION_ERROR 	'Z'



#define commTask_stackSize (( unsigned portSHORT )500)

#include "structures.h"

/*************************************************************************

**************************************************************************/
void executeCommTask(globals_t *pvParameters);


/**@}*/
#endif
